package com.taotao.order.spring.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

import com.taotao.order.dao.impl.JedisClientSingle;

import redis.clients.jedis.JedisPool;

@Configuration
@PropertySource(value = { "classpath:redis.properties" }, ignoreResourceNotFound = true)
public class RedisConfig {
	@Value("${redis.host}")
	private String host;
	@Value("${redis.port}")
	private Integer port;

	@Bean
	public JedisPool jedisPool() {
		JedisPool jedisPool = new JedisPool(host, port);
		return jedisPool;
	}

	@Bean
	public JedisClientSingle jedisClient() {
		return new JedisClientSingle();
	}
}
